import Constants from "../libs/Constants";
import GameData from "../libs/GameData";

const {ccclass, property} = cc._decorator;

@ccclass
export default class UIReward extends cc.Component {

    @property(cc.Label)
    num1: cc.Label = null;
    @property(cc.Label)
    num2: cc.Label = null;

   
    reward:number = 0;


    // onLoad () {}

    start () {
        this.reward =  Constants.SignReward[GameData.instance.signDays.length-1];
        this.refreshUI();
    }

    refreshUI(){
        this.num1.string = this.reward.toString();
        this.num2.string = this.reward.toString();


    }

    onSure(){
        GameData.instance.playGold += this.reward;
        GameData.instance.saveData();
        this.node.removeFromParent();
        this.node.destroy();

    }

}
